import React from "react";

export default class MyNav extends React.Component {
  render() {
    console.log(this.props.nav);
    return (
      <div>
        {/* this.props获取传参 props不可被修改只读 */}
        <h2>{this.props.title}</h2>
        <ul>
          {this.props.nav.map((ele, index) => {
            // console.log(this);
            return <li key={index}>{ele}</li>;
          })}
        </ul>
      </div>
    );
  }
}
